<?php

declare(strict_types=1);

/**
 * @Author:     Frank
 * @contact     frank_hhm@163.com
 * @Date:       2023-02-02 09:54:51
 * @Last Modified time: 2023-02-02 10:05:06
 */
namespace app\api\controller\common;	
use frank\services\FileUploadService;

/**
 * Class GrantedPublics
 */
class GrantedPublics extends  \app\api\controller\Base
{ 	
   
    /**
     * 上传图片
     * @method(POST)
     */
    public function uploadImage()
    {
		$service = FileUploadService::instance();
        $service->setPath('image');
        $param = array (
            "name" => "image",
            "source_id" =>$this->uid,
            "group_id" =>0,
            "source" =>20,
        );
        if($data = $service->imagem($param)){
            $this->success('上传成功',$data);
        }
        $this->error($service->getError() ?: '上传失败');
    }
}
